package com.sc.nft.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.dto.OpenRedPackMessageDTO;
import com.sc.nft.entity.EcologyPoolRedPackReceive;
import com.sc.nft.entity.vo.EcologyPoolRedPackReceiveVO;

import java.math.BigDecimal;

/**
 * 品牌红包领取记录服务接口
 *
 * @author jinpinhai
 * @since 2024-08-10 11:40:15
 */
public interface EcologyPoolRedPackReceiveService {


    /**
     * mq发放消费积分
     * @param openRedPackMessageDTO openRedPackMessageDTO
     */
    void distributeConsumptionPoints(OpenRedPackMessageDTO openRedPackMessageDTO);

    /**
     * 用户红包参与记录
     *
     * @param userId  userId
     * @param daoId   daoId
     * @param pageNo  pageNo
     * @param pageNum pageNum
     * @return EcologyPoolRedPackReceive
     */
    Page<EcologyPoolRedPackReceive> redPackParticipatePage(Long userId, Long daoId, Integer pageNo, Integer pageNum);

    /**
     * 红包参与记录
     *
     * @param pageNo       pageNo
     * @param pageNum      pageNum
     * @param daoRedPackId daoRedPackId
     * @param userTel      userTel
     * @return EcologyPoolRedPackReceiveVO
     */
    IPage<EcologyPoolRedPackReceiveVO> daoRedPackReceivePage(Integer pageNo, Integer pageNum, Long daoRedPackId, String userTel);

    /**
     * 保存红包领取记录
     *
     * @param redPackReceive redPackReceive
     */
    void saveRedPackReceive(EcologyPoolRedPackReceive redPackReceive);

    /**
     * 统计用户领取次数
     *
     * @param userId    userId
     * @param redPackId redPackId
     * @return int 领取次数
     */
    int countUserReceive(Long userId, Long redPackId);

    /**
     * 统计领取数量
     * @param redPackId redPackId
     * @return int
     */
    int countReceive(Long redPackId);

    /**
     * 统计领取额度
     * @param redPackId redPackId
     * @return int
     */
    BigDecimal sumReceive(Long redPackId);

}
